var e = require("../../../wxParse/wxParse"), t = getApp();

Page({
    data: {
        group: {},
        deliver: {},
        themeColor: "#f14e4e"
    },
    onLoad: function(e) {
        this.getData(e.buyingid, e.deliver_id);
    },
    back: function() {
        wx.navigateBack();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    getData: function(a, o) {
        var n = this, i = this, r = t.getNetAddresss("plugin.package-deliver.frontend.communityGroups.groupDetail");
        t._getNetWork({
            url: r,
            data: {
                id: a,
                deliver_id: o
            },
            success: function(t) {
                var a = t.data;
                if (1 === a.result) {
                    var o = a.data.group, r = a.data.deliver;
                    n.setData({
                        group: o,
                        deliver: r
                    });
                    var u = a.data.group.description, d = 0;
                    0 == n.data.group.group_status ? d = new Date(n.data.group.start_time.replace(/-/g, "/")).getTime() - new Date().getTime() : 1 == n.data.group.group_status && (d = new Date(n.data.group.end_time.replace(/-/g, "/")).getTime() - new Date().getTime()), 
                    n.setData({
                        time: d
                    }), console.log(n.data.time);
                    try {
                        u.indexOf("&#") <= -1 && e.wxParse("article", "html", u, i);
                    } catch (e) {
                        console.log(e);
                    }
                    o.color && n.setData({
                        themeColor: o.color
                    });
                }
            }
        });
    },
    onChangeTime: function(e) {
        this.setData({
            timeData: e.detail
        });
    },
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});